 package kn.mx.cstf2.sql;

import kn.cstf2.cop.Sql.*;

 public class AssignSql {
   public static final String SELECCIONAR_KNKEYS;
   public static final String SELECCIONAR_CUSTOMERNUM;
   public static final String SELECCT_ASSIGNUSERS_TOKNKEY;
   public static final String SELECCT_DATAFROM_TUSERS;
   public static final String SELECCT_DATAFROM_TUSERS_FROMID;
   public static final String SELECCIONAR_COMPANY_FROMSTK;
   public static final String SELECCIONAR_RESTDATA;
   public static final String SELECCIONAR_RESTDATA1;
   public static final String SELECT_IDTRANSITION_FROM_KNKEY;
   public static final String SELECT_COMPANYNAMES_FROM_KNKEY;
   public static final String INSERT_RELATIONUSERKNKEY;
   public static final String DELETE_RELATIONUSERKNKEY;
   public static final String SELECT_ONE_IDTRANSITION_FROM_KNKEY;
   public static final String SELECT_KNKEY_FROM_TCLIENTES;

    
    
   static {
       StringBuilder qryBuilder = new StringBuilder();
       qryBuilder.append("SELECT t.id,t.knkey, t.status, t.statusimple, t.updated, j.iduser	FROM t_transitions t");
       qryBuilder.append(" INNER JOIN joinusertransition j");
       qryBuilder.append(" ON (t.id = j.idtransition)");
       qryBuilder.append(" WHERE j.iduser = ?");
        SELECCIONAR_KNKEYS = qryBuilder.toString();
        
        qryBuilder = new StringBuilder();
       qryBuilder.append(" SELECT * FROM c_users_vs_clientes WHERE winuser = ? ");
        SELECCIONAR_CUSTOMERNUM = qryBuilder.toString();
        
       qryBuilder = new StringBuilder();
       qryBuilder.append(" SELECT knkey FROM t_clientes WHERE knkey = ? ");
       SELECT_KNKEY_FROM_TCLIENTES = qryBuilder.toString();

       qryBuilder = new StringBuilder();
       qryBuilder.append(" SELECT * FROM t_users WHERE username LIKE ? ");
       SELECCT_DATAFROM_TUSERS = qryBuilder.toString();
        

       qryBuilder = new StringBuilder();
       qryBuilder.append(" SELECT * FROM t_users WHERE id = ? ");
       SELECCT_DATAFROM_TUSERS_FROMID = qryBuilder.toString();
        

       qryBuilder = new StringBuilder();
       qryBuilder.append("  ");
       SELECCT_ASSIGNUSERS_TOKNKEY = qryBuilder.toString();


       qryBuilder = new StringBuilder();
       qryBuilder.append("select companyname, creationdate from t_clientes where knkey = ? ");
       SELECCIONAR_COMPANY_FROMSTK = qryBuilder.toString();


       qryBuilder = new StringBuilder();
       qryBuilder.append("select status, statusimple, updated from t_transitions where knkey = ? ");
       SELECCIONAR_RESTDATA = qryBuilder.toString();
       
       qryBuilder = new StringBuilder();
       qryBuilder.append("select status, statusimple, updated1 from t_transitions where knkey = ? ");
       SELECCIONAR_RESTDATA1 = qryBuilder.toString();

       qryBuilder = new StringBuilder();
       qryBuilder.append("select id from t_transitions where knkey = ? ");
       SELECT_IDTRANSITION_FROM_KNKEY = qryBuilder.toString();


       qryBuilder = new StringBuilder();
       qryBuilder.append("INSERT INTO joinusertransition (iduser ,idtransition) values(?, ?); ");
       INSERT_RELATIONUSERKNKEY = qryBuilder.toString();


       qryBuilder = new StringBuilder();
       qryBuilder.append("SELECT id FROM t_transitions WHERE knkey = ?  ");
       SELECT_ONE_IDTRANSITION_FROM_KNKEY = qryBuilder.toString();


       qryBuilder = new StringBuilder();
       qryBuilder.append("DELETE FROM joinusertransition WHERE iduser = ? AND idtransition = ? ");
       DELETE_RELATIONUSERKNKEY = qryBuilder.toString();
       
       qryBuilder = new StringBuilder();
       qryBuilder.append("SELECT companyname FROM t_clientes WHERE knkey = ? ");
       SELECT_COMPANYNAMES_FROM_KNKEY = qryBuilder.toString();
   }
}
